package edu.java.homework.hw08.ipj08.exer01done;

public class RaznostranenTriangle extends RavnobedrenTriangle {

    // --- Instance Variables --------------------------------------------------
    double side3 = 0.0d;

    // --- Constructors --------------------------------------------------------

    public RaznostranenTriangle() {
	this(0, 0, 0);
    }

    public RaznostranenTriangle(double side1, double side2, double side3) {
	super(side1, side2);
	this.side3 = side3;
    }

    // --- Getters and Setters -------------------------------------------------

    public double getSide3() {
	return side3;
    }

    public void setSide3(double side3) {
	this.side3 = side3;
    }

    // --- Method Override -----------------------------------------------------

    @Override
    public double getPerimeter() {
	return getSide1() + getSide2() + getSide3();
    }

    @Override
    public double getSurface() {
	double semiP = getPerimeter() / 2;
	double tmp = semiP * (semiP - getSide1()) * (semiP - getSide2())
		* (semiP - getSide3());
	return Math.sqrt(tmp);
    }
    
    @Override
    public String toString(){
	StringBuffer sb=new StringBuffer();
	sb.append(super.toString()).append("\n");
	sb.append("side3: ").append(getSide3());
	
	return sb.toString();
    }
    
    

}
